<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  Templates.protostar
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Getting params from template
$params = JFactory::getApplication()->getTemplate(true)->params;

$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$doc->setGenerator('Thanh Lam');
$server = "http://".$_SERVER['HTTP_HOST'];

$this->language = $doc->language;
$this->direction = $doc->direction;

// Detecting Active Variables
$option   = $app->input->getCmd('option', '');
$view     = $app->input->getCmd('view', '');
$layout   = $app->input->getCmd('layout', '');
$task     = $app->input->getCmd('task', '');
$itemid   = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');

if($task == "edit" || $layout == "form" )
{
	$fullWidth = 1;
}
else
{
	$fullWidth = 0;
}

// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');

// Add nivoslider
$doc->addScript('http://code.jquery.com/jquery-1.6.4.js');
$doc->addScript('https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js');
$doc->addScript('templates/'.$this->template.'/js/jquery.nivo.slider.js');
$doc->addScript('templates/'.$this->template.'/js/fiddlescrollbar.js');

$nivoScript = '
jQuery(window).load(function() {
	jQuery(\'#slider\').nivoSlider({
		effect:\'fade\',
		pauseTime: 5000,		
		controlNav: false
	});	
});';
$floatingCart = '
	var name = "#aside";  
    var menuYloc = null;  
    jQuery(document).ready(function(){  
        menuYloc = jQuery(name).css("top").substring(0,jQuery(name).css("top").indexOf("px"))  
        jQuery(window).scroll(function () {   
			//228px = height of the header
		    var offset = menuYloc+jQuery(document).scrollTop(); 
			var marginTop = 0;
			if(offset < 350){
				offset = 0;
			}
			else{ 
				offset = offset - 350;
			}	
			console.log(offset);
		
			var strOffset = offset + "px";
            jQuery(name).animate({top:strOffset},{duration:500,queue:false});  
		});  
    });   		
';
$miniCartScrollBar = '
jQuery(document).ready(function(){    
	jQuery("#miniK2StoreCart").slimscroll({
	     color: "#F36D1F",
	     size: "10px",
	     width: "180px",
	     height: "250px"                  
	});
});';
//$doc->addScriptDeclaration($nivoScript);
//$doc->addScriptDeclaration($floatingCart);
//$doc->addScriptDeclaration($miniCartScrollBar);
// Add Stylesheets
$doc->addStyleSheet('templates/'.$this->template.'/css/template.css');


// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', false, $this->direction);

// Add current user information
$user = JFactory::getUser();

// Adjusting content width
if ($this->countModules('position-7') && $this->countModules('position-8'))
{
	$span = "span6";
}
elseif ($this->countModules('position-7') && !$this->countModules('position-8'))
{
	$span = "span9";
}
elseif (!$this->countModules('position-7') && $this->countModules('position-8'))
{
	$span = "span9";
}
else
{
	$span = "span12";
}

// Logo file or site title param
if ($this->params->get('logoFile'))
{
	$logo = '<img src="'. JURI::root() . $this->params->get('logoFile') .'" alt="'. $sitename .'" />';
}
elseif ($this->params->get('sitetitle'))
{
	$logo = '<span class="site-title" title="'. $sitename .'">'. htmlspecialchars($this->params->get('sitetitle')) .'</span>';
}
else
{
	$logo = '<span class="site-title" title="'. $sitename .'">'. $sitename .'</span>';
}
?>
<!DOCTYPE html>
<html xmlns:fb="http://ogp.me/ns/fb#" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<jdoc:include type="head" />
	
	<?php
	// Use of Google Font
	if ($this->params->get('googleFont'))
	{
	?>
		<link href='http://fonts.googleapis.com/css?family=Patrick+Hand' rel='stylesheet' type='text/css' />
		<style type="text/css">
			body,h1,h2,h3,h4,h5,h6,.site-title{
				font-family: 'Tahoma', cursive;
			}
		</style>
	<?php
	}
	?>
	<?php
	// Template color
	if ($this->params->get('templateColor'))
	{
	?>
	<style type="text/css">
		body.site
		{			
			background-color: <?php echo $this->params->get('templateBackgroundColor');?>
		}
		a
		{
			color: <?php echo $this->params->get('templateColor');?>;
		}
		.navbar-inner, .nav-list > .active > a, .nav-list > .active > a:hover, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .nav-pills > .active > a, .nav-pills > .active > a:hover,
		.btn-primary
		{
			background: <?php echo $this->params->get('templateColor');?>;
		}
		.navbar-inner
		{
			-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
			-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
			box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
		}
	</style>
	<?php
	}
	?>
	<!--[if lt IE 9]>
		<script src="<?php echo $this->baseurl ?>/media/jui/js/html5.js"></script>
	<![endif]-->
	
	<script>
    
	</script>
</head>

<body id="body" class="site <?php echo $option
	. ' view-' . $view
	. ($layout ? ' layout-' . $layout : ' no-layout')
	. ($task ? ' task-' . $task : ' no-task')
	. ($itemid ? ' itemid-' . $itemid : '')
	. ($params->get('fluidContainer') ? ' fluid' : '');
?>">
	<!-- Body -->
	<?php if($option=='com_k2'&& $view=='item'):?>
		<div id="fb-root"></div>
		<script>(function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=118636581485120";
		  fjs.parentNode.insertBefore(js, fjs);
		}(document, 'script', 'facebook-jssdk'));</script>
	<?php endif;?>
	<div class="body">
		<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : '');?>">
			<!-- Header -->
			<div class="header">
				<div class="header-inner row-fluid">
					<a class="brand span3" href="<?php echo $this->baseurl; ?>">
						<?php echo $logo;?> <?php if ($this->params->get('sitedescription')) { echo '<div class="site-description">'. htmlspecialchars($this->params->get('sitedescription')) .'</div>'; } ?>
					</a>
					<div class="header-search span6">						
						<h1 style="text-transform: uppercase;font-size:29px;">Bánh Canh Vịt - Xôi Hoàng</h1>
						<p>Địa chỉ: 604-606 Sư Vạn Hạnh P.2 Q.10 TP. Hồ Chí Minh</p>
						<p>Email: dat_dep_trai@gmail.com</p>		
						<h1 style="color:#F36D1F">Hotline: 0166.516.3079</h1>					
					</div>
					<div class="social span3">
						<a class="social_twitter" target="blank" href="https://twitter.com/ThanhLam15"></a>
						<a class="social_facebook" target="blank" href="https://www.facebook.com/BanhCanhVitXoiHoang"></a>
						<a class="social_gplus" target="blank" href="https://plus.google.com/104060336978085540380/"></a>
						<a class="social_yahoo" href="ymsgr:SendIM?banhcanhvitxoihoang"></a>
						<a class="social_skype" target="blank" href="skype:deno028?chat"></a>
					</div>
				</div>
			</div>
			<?php if ($this->countModules('position-1')) : ?>
			<div class="navigation">
				<jdoc:include type="modules" name="position-1" style="none" />
			</div>
			<?php endif; ?>
			<div class="banner">
				<jdoc:include type="modules" name="banner" style="xhtml" />
			</div>
			<div class="row-fluid" style="position: relative;">
				<?php if ($this->countModules('position-8')) : ?>
				<!-- Begin Sidebar -->
				<div id="sidebar" class="span3">
					<div class="sidebar-nav">
						<jdoc:include type="modules" name="position-8" style="xhtml" />
					</div>
				</div>
				<!-- End Sidebar -->
				<?php endif; ?>
				<div id="content" class="<?php echo $span;?>">
					<!-- Begin Content -->
					<jdoc:include type="modules" name="position-3" style="xhtml" />
					<jdoc:include type="message" />
					<jdoc:include type="component" />
					<div class=".icon-cart"></div>
					<jdoc:include type="modules" name="position-2" style="none" />
					<!-- End Content -->
				</div>
				<?php if ($this->countModules('position-7')) : ?>
				<div id="aside" class="span3" style="position: absolute;right:0;top:0;">
					<!-- Begin Right Sidebar -->
					<jdoc:include type="modules" name="position-7" style="well" />
					<!-- End Right Sidebar -->
				</div>
				<?php endif; ?>
			</div>
			<!-- Footer -->
			<div class="footer row-fluid">
				<div class="span12">
					<hr />
					<jdoc:include type="modules" name="footer" style="none" />
					<p class="pull-right"><a href="#top" id="back-top"><?php echo JText::_('TPL_PROTOSTAR_BACKTOTOP'); ?></a></p>
					<p>&copy; <?php echo $sitename; ?> <?php echo date('Y');?></p>
				</div>
			</div>
		</div>
	</div>
	
	<?php /**/?>
	<!--<div id="slider" style="position: fixed;top:0;left:0;width:100%;height:100%;z-index:-9999;" class="nivoSlider">
     <img style="display:none;" src="images/slider/BanhCanhVit.jpg" data-thumb="images/slider/BanhCanhVit.jpg" alt=""  />
     <img style="display:none;" src="images/slider/BoNe.jpg" data-thumb="images/slider/BoNe.jpg" alt="" />
     <img style="display:none;" src="images/slider/Goi-Vit.jpg" data-thumb="images/slider/BoNe.jpg" alt=""  />
     <img style="display:none;" src="images/slider/HaoNe.jpg" data-thumb="images/slider/HaoNe.jpg" alt=""   />
     <img style="display:none;" src="images/slider/PhaLau.jpg" data-thumb="images/slider/PhaLau.jpg" alt=""  />
     <img style="display:none;" src="images/slider/XoiHoang.jpg" data-thumb="images/slider/XoiHoang.jpg" alt=""   />
	</div>-->
<?php /**/ ?>
	<jdoc:include type="modules" name="debug" style="none" />
</body>
</html>
